package outbound

import (
	"gateway/config"
	"gateway/core"
	"go.uber.org/zap"
)

const (
	HOST    = "host"
	PATH    = "path"
	METHOD  = "method"
	HEADERS = "headers"
)

func getOutboundFunc(name string) func(string) core.Outbound {
	switch name {
	case "httpOutbound":
		return newHttpOutbound
	default:
		return nil
	}
}

func NewOutbound(name string) core.Outbound {
	f := getOutboundFunc(name)
	if f == nil {
		config.Logger.Panic("Outbound not found", zap.String("name", name))
	}
	return f(name)
}
